<template>
  <div class="recommend">
    <div class="recommend-item" v-for="(item, index) in recommends" :key="'recommend' + index">
      <a :href="item.link">
        <img class="recommend-img" v-lazy="item.image" alt />
        <div class="recommend-text">{{ item.title }}</div>
      </a>
    </div>
  </div>
</template>

<script>
export default {
  name: "RecommendView",
  // 父组件传递数据
  props: {
    recommends: {
      type: Array,
      default() {
        return [];
      },
    },
  },
};
</script>

<style lang="less">
.recommend {
  display: flex;
  width: 100%;
  padding: 10px 0 20px;
  border-bottom: 5px solid var(--color-bottom);
  text-align: center;
  // 推荐模块
  .recommend-item {
    flex: 1;
    // 图片
    .recommend-img {
      height: 70px;
      width: 70px;
      margin-bottom: 10px;
    }
    // 文字
    .recommend-text {
      font-size: 12px;
    }
  }
}
</style>